import requests

try:
    page = 1
    res = requests.get(
        f"https://www.zhipin.com/web/geek/job?query=python&city=101250100&page={page}",
        proxies={
            "http": "http://20.205.61.143:80",
        },
        headers={
            "user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36",
            "referer": "hthttps://www.zhipin.com/changsha/",
            "cookie": "wd_guid=cd401060-4634-4212-8e6a-0470b87cd213; historyState=state; _bl_uid=5Cltmm353pvmdenz5oydxbFlqLqy; __zp_seo_uuid__=a73851ee-855b-4d5a-90ae-927434ee3866; __g=-; Hm_lvt_194df3105ad7148dcf2b98a91b5e727a=1700803910; boss_login_mode=app; lastCity=101250100; Hm_lpvt_194df3105ad7148dcf2b98a91b5e727a=1700814087; __l=r=https%3A%2F%2Fcn.bing.com%2F&l=%2Fwww.zhipin.com%2Fchangsha%2F&s=3&g=&friend_source=0&s=3&friend_source=0; __c=1700803910; __a=42686398.1693756083.1693756083.1700803910.29.2.23.29; __zp_stoken__=8d36eCxVbYEh3CS4SfDxARFoIX2JDUmBcH1JKEEhfdgESXmZ0RlUQdEBjWz9caQNIEXBWe1JAWw9ja10nSnVpeEp%2FdH48dhZtdwx2D35HfjcQKkZeGQBdPwNiL2YtLTZ4Mg4WeAQRfkoUKCtoJR14BA4fMHF%2BT0xnBnddBUF0DQ%3D%3DD",
        },
    )
    print(res)
    with open(f"./html/page{page}.html", "w", encoding="utf-8") as f:
        f.write(res.text)
except Exception as e:
    print(e.args)
